From 8f2b06e47c37b409f71240e0739361aad8cae3dd Mon Sep 17 00:00:00 2001 From: robertlipe Date: Wed, 23 Apr 2014 02:33:03 +0000 Subject: [PATCH] Remove our own va_copy implementation. That's just silly in modern times. --- gpsbabel/configure | 123 ------------------------------------------ gpsbabel/configure.in | 48 ----------------- gpsbabel/defs.h | 11 ---- 3 files changed, 182 deletions(-) diff --git a/gpsbabel/configure b/gpsbabel/configure index dd2c80a6b..ab1cebc86 100755 --- a/gpsbabel/configure +++ b/gpsbabel/configure @@ -4836,129 +4836,6 @@ fi done -# -# Checks for how the system handles va_list -# paul.bromiley@man.ac.uk -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 -$as_echo_n "checking for va_copy... " >&6; } -if ${ac_cv_c_va_copy+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -va_list ap1, ap2; - va_copy(ap1,ap2); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_c_va_copy="yes" -else - ac_cv_c_va_copy="no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_va_copy" >&5 -$as_echo "$ac_cv_c_va_copy" >&6; } -if test "$ac_cv_c_va_copy" = "yes" -then - -$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5 -$as_echo_n "checking for __va_copy... " >&6; } -if ${ac_cv_c___va_copy+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -va_list ap1, ap2; - __va_copy(ap1,ap2); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_c___va_copy="yes" -else - ac_cv_c___va_copy="no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c___va_copy" >&5 -$as_echo "$ac_cv_c___va_copy" >&6; } -if test "$ac_cv_c___va_copy" = "yes" -then - -$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h - -fi - -# -# Does this platform require array notation to assign to a va_list? -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking va_list assignments need array notation" >&5 -$as_echo_n "checking va_list assignments need array notation... " >&6; } -if ${ac_cv_valistisarray+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_valistisarray=false -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - void foo(int i, ...) { - va_list ap1, ap2; - va_start(ap1, i); - ap2 = ap1; - if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) { exit(1); } - va_end(ap1); va_end(ap2); - } - int main() - { foo(0, 123); return(0); } -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - ac_cv_valistisarray=false -else - ac_cv_valistisarray=true -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi - - -if test "$ac_cv_valistisarray" = true ; then - -$as_echo "#define HAVE_VA_LIST_AS_ARRAY 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - # # There's probably some more "autoconfish" way to do this. # diff --git a/gpsbabel/configure.in b/gpsbabel/configure.in index db98f6db4..9f2527794 100644 --- a/gpsbabel/configure.in +++ b/gpsbabel/configure.in @@ -330,54 +330,6 @@ AC_SUBST(DOCDIR) # AC_CHECK_FUNCS([atexit floor localtime_r memmove memset pow select sqrt strchr strcspn strdup strerror strncasecmp strrchr strspn strstr strtol strtoul]) AC_CHECK_FUNCS([nanosleep sleep uname glob]) -# -# Checks for how the system handles va_list -# paul.bromiley@man.ac.uk -# -dnl **** Check for va_copy **** -AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy, - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[va_list ap1, ap2; - va_copy(ap1,ap2); - ]])],[ac_cv_c_va_copy="yes"],[ac_cv_c_va_copy="no"]) - ) -if test "$ac_cv_c_va_copy" = "yes" -then - AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy]) -fi -AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy, - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[va_list ap1, ap2; - __va_copy(ap1,ap2); - ]])],[ac_cv_c___va_copy="yes"],[ac_cv_c___va_copy="no"]) - ) -if test "$ac_cv_c___va_copy" = "yes" -then - AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy]) -fi - -# -# Does this platform require array notation to assign to a va_list? -# -AC_MSG_CHECKING(va_list assignments need array notation) -AC_CACHE_VAL(ac_cv_valistisarray, - [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include - #include - void foo(int i, ...) { - va_list ap1, ap2; - va_start(ap1, i); - ap2 = ap1; - if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) { exit(1); } - va_end(ap1); va_end(ap2); - } - int main() - { foo(0, 123); return(0); }]])],[ac_cv_valistisarray=false],[ac_cv_valistisarray=true],[ac_cv_valistisarray=false])]) - -if test "$ac_cv_valistisarray" = true ; then - AC_DEFINE(HAVE_VA_LIST_AS_ARRAY, 1, [Define as 1 if your va_list type is an array]) - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi - # # There's probably some more "autoconfish" way to do this. # diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 4a9f5fd5a..8da17370c 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -135,17 +135,6 @@ # define NORETURN void #endif -#ifndef HAVE_VA_COPY -# ifdef __va_copy -# define va_copy(DEST,SRC) __va_copy((DEST),(SRC)) -# else -# ifdef HAVE_VA_LIST_AS_ARRAY -# define va_copy(DEST,SRC) (*(DEST) = *(SRC)) -# else -# define va_copy(DEST,SRC) ((DEST) = (SRC)) -# endif -# endif -#endif /* * Common definitions. There should be no protocol or file-specific -- 2.30.2